package huixue.cn.com.rxapp.widget.lock;

import android.content.Context;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

import huixue.cn.com.library.util.PixelUtils;

/**
 * Created by gongdongyang 2019/7/29
 * Describe:
 */
public class GestureLockLayout extends RelativeLayout {

    private static final String TAG = "GestureLockLayout";

    //模式选择，重置密码，设置密码模式
    public static final int RESET_MODE = 0;
    //验证密码模式
    public static final int VERIFY_MODE = 1;

    //画笔
    private Paint mPaint;

    private Path mPath;

    //连接线的宽度
    private float mStrokeWidth = 2;

    public GestureLockLayout(Context context) {
        this(context,null);
    }

    public GestureLockLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    private void init(final Context context) {

        mPaint = new Paint();

        mPaint.setAntiAlias(true);
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setStrokeWidth(PixelUtils.dp2px(mStrokeWidth));
        mPaint.setStrokeCap(Paint.Cap.ROUND);
        mPaint.setStrokeJoin(Paint.Join.ROUND);

        mPath = new Path();
    }

}
